package com.company.loganalyzer.dto;

import java.time.LocalDateTime;

/**
 * TraceId分析请求DTO
 * 用于接收traceId智能分析的请求参数
 */
public class TraceAnalysisRequest {
    
    private String traceId;
    private String timeRange; // "last_24h", "last_7d" 或自定义
    private LocalDateTime startTime; // 自定义时间范围开始
    private LocalDateTime endTime;   // 自定义时间范围结束
    private String serviceName;     // 可选：指定服务名称
    private boolean includeInfoLogs; // 是否包含INFO级别日志，默认false
    private int maxLogs;            // 最大日志数量，默认1000
    
    // 构造函数
    public TraceAnalysisRequest() {}
    
    public TraceAnalysisRequest(String traceId) {
        this.traceId = traceId;
        this.timeRange = "last_24h";
        this.includeInfoLogs = false;
        this.maxLogs = 1000;
    }
    
    // Getters and Setters
    public String getTraceId() {
        return traceId;
    }
    
    public void setTraceId(String traceId) {
        this.traceId = traceId;
    }
    
    public String getTimeRange() {
        return timeRange;
    }
    
    public void setTimeRange(String timeRange) {
        this.timeRange = timeRange;
    }
    
    public LocalDateTime getStartTime() {
        return startTime;
    }
    
    public void setStartTime(LocalDateTime startTime) {
        this.startTime = startTime;
    }
    
    public LocalDateTime getEndTime() {
        return endTime;
    }
    
    public void setEndTime(LocalDateTime endTime) {
        this.endTime = endTime;
    }
    
    public String getServiceName() {
        return serviceName;
    }
    
    public void setServiceName(String serviceName) {
        this.serviceName = serviceName;
    }
    
    public boolean isIncludeInfoLogs() {
        return includeInfoLogs;
    }
    
    public void setIncludeInfoLogs(boolean includeInfoLogs) {
        this.includeInfoLogs = includeInfoLogs;
    }
    
    public int getMaxLogs() {
        return maxLogs;
    }
    
    public void setMaxLogs(int maxLogs) {
        this.maxLogs = maxLogs;
    }
    
    @Override
    public String toString() {
        return "TraceAnalysisRequest{" +
               "traceId='" + traceId + '\'' +
               ", timeRange='" + timeRange + '\'' +
               ", startTime=" + startTime +
               ", endTime=" + endTime +
               ", serviceName='" + serviceName + '\'' +
               ", includeInfoLogs=" + includeInfoLogs +
               ", maxLogs=" + maxLogs +
               '}';
    }
}